﻿    using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using ModelGymTauro;

namespace ViewGymTauro
{
    public partial class Menu : Form
    {
        private int dni;
        private Empleado empleado;
        private InfoPersonal ventana;

        public int Dni
        {
            get { return dni; }
            set { dni = value; }
        }
        public Menu(String tipo, String name,int dni)
        {
            
            InitializeComponent();
            this.Dni = dni;
            empleado = IniciaSesion.gymMan.getEmpleadoByDni(this.Dni);
            ventana = new InfoPersonal(empleado);
            ventana.MdiParent = this;
            ventana.WindowState = FormWindowState.Maximized;
            ventana.Show();
            
            this.ventaToolStripMenuItem.Visible = false;
            this.maquinaToolStripMenuItem.Visible = false;
            this.deportistaToolStripMenuItem.Visible = false;
            this.compraToolStripMenuItem.Visible = false;
            this.rutinasToolStripMenuItem.Visible = false;
            
            this.actividadToolStripMenuItem.Visible = false;
            this.citaToolStripMenuItem.Visible = false;
            this.membresiaToolStripMenuItem.Visible = false;
            this.ejercicioToolStripMenuItem.Visible = false;
            this.empleadoToolStripMenuItem.Visible = false;
            this.promocionToolStripMenuItem.Visible = false;
           
            this.salirToolStripMenuItem.Visible = true;
          

            this.linkLabel1.Text = name;
            if (tipo.Equals("asistente")) {

               
                this.maquinaToolStripMenuItem.Visible = true;
                this.deportistaToolStripMenuItem.Visible = true;
                this.rutinasToolStripMenuItem.Visible = true;
                this.actividadToolStripMenuItem.Visible = true;
                this.membresiaToolStripMenuItem.Visible = true;
                this.ejercicioToolStripMenuItem.Visible = true;
                this.promocionToolStripMenuItem.Visible = true;
              
            
            
            }
            if (tipo.Equals("cajero"))
            {
                this.deportistaToolStripMenuItem.Visible = true;
                this.ventaToolStripMenuItem.Visible = true;
                this.promocionToolStripMenuItem.Visible = true;

            }
            if (tipo.Equals("gerente general"))
            {

                this.empleadoToolStripMenuItem.Visible = true;
                this.ventaToolStripMenuItem.Visible = true;
                this.compraToolStripMenuItem.Visible = true;
               

            }
            if (tipo.Equals("profesor"))
            {
                this.deportistaToolStripMenuItem.Visible = true;
                this.actividadToolStripMenuItem.Visible = true;


            }
            if (tipo.Equals("entrenador"))
            {
                this.deportistaToolStripMenuItem.Visible = true;
                this.rutinasToolStripMenuItem.Visible = true;
                this.ejercicioToolStripMenuItem.Visible = true;


            }

            if (tipo.Equals("nutricionista"))
            {
                this.deportistaToolStripMenuItem.Visible = true;
                this.citaToolStripMenuItem.Visible = true;


            }

            
        }

       

        

      

        private void linkLabel1_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
           
            ventana.Show();
            
        }

        private void salirToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Application.Exit();
        }

        private void nuevoToolStripMenuItem6_Click(object sender, EventArgs e)
        {
            Empleado_Nuevo ventana = new Empleado_Nuevo();
            ventana.MdiParent = this;
            ventana.WindowState = FormWindowState.Maximized;
            ventana.Show();

        }

        private void buscarToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Empleado_Buscar ventana = new Empleado_Buscar();
            ventana.MdiParent = this;
            ventana.WindowState = FormWindowState.Maximized;
            ventana.Show();

        }

        private void nuevoToolStripMenuItem4_Click(object sender, EventArgs e)
        {
            Deportista_Nuevo ventana = new Deportista_Nuevo();
            ventana.MdiParent = this;
            ventana.WindowState = FormWindowState.Maximized;
            ventana.Show();
        }

        private void buscarToolStripMenuItem2_Click(object sender, EventArgs e)
        {
            Deportista_Buscar ventana = new Deportista_Buscar();
            ventana.MdiParent = this;
            ventana.WindowState = FormWindowState.Maximized;
            ventana.Show();
        }

        private void nuevoToolStripMenuItem1_Click(object sender, EventArgs e)
        {
            Actividad_nueva ventana = new Actividad_nueva();
            ventana.MdiParent = this;
            ventana.WindowState = FormWindowState.Maximized;
            ventana.Show();

        }

        private void asignarProfesorToolStripMenuItem_Click(object sender, EventArgs e)
        {

        }

        private void Menu_FormClosing(object sender, FormClosingEventArgs e)
        {
            Application.Exit();
        }

        private void nuevaToolStripMenuItem1_Click(object sender, EventArgs e)
        {

        }

        private void nuevoToolStripMenuItem2_Click(object sender, EventArgs e)
        {
            Membresia_nueva ventana = new Membresia_nueva();
            ventana.MdiParent = this;
            ventana.WindowState = FormWindowState.Maximized;
            ventana.Show();
        }

        private void consultarRutinaToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Rutina_modificar ventana = new Rutina_modificar();
            ventana.MdiParent = this;
            ventana.WindowState = FormWindowState.Maximized;
            ventana.Show();
        }

        private void asignarDeportistaToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Rutina_asignar ventana = new Rutina_asignar();
            ventana.MdiParent = this;
            ventana.WindowState = FormWindowState.Maximized;
            ventana.Show();
        }

        private void agregarRutinaToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Rutina_agregar ventana = new Rutina_agregar();
            ventana.MdiParent = this;
            ventana.WindowState = FormWindowState.Maximized;
            ventana.Show();
        }

        private void mostrarRutinaToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Rutina_mostrar ventana = new Rutina_mostrar();
            ventana.MdiParent = this;
            ventana.WindowState = FormWindowState.Maximized;
            ventana.Show();
        }

        private void nuevoToolStripMenuItem5_Click(object sender, EventArgs e)
        {
            Ejercicio_nuevo ventana = new Ejercicio_nuevo();
            ventana.MdiParent = this;
            ventana.WindowState = FormWindowState.Maximized;
            ventana.Show();
        }

        private void mostrarEjercicioToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Ejercicio_mostrar ventana = new Ejercicio_mostrar();
            ventana.MdiParent = this;
            ventana.WindowState = FormWindowState.Maximized;
            ventana.Show();
        }

        private void modificarEjercicioToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Ejercicio_modificar ventana = new Ejercicio_modificar();
            ventana.MdiParent = this;
            ventana.WindowState = FormWindowState.Maximized;
            ventana.Show();
        }

        private void consultarMisRutinasToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Deportista_consultarRutinas ventana = new Deportista_consultarRutinas();
            ventana.MdiParent = this;
            ventana.WindowState = FormWindowState.Maximized;
            ventana.Show();
        }

        private void productoToolStripMenuItem_Click(object sender, EventArgs e)
        {
            string nombCajero = empleado.Nombre + " " + empleado.Apellido;
            //Venta_Producto_nuevo vPN = new Venta_Producto_nuevo(nombCajero);
            //vPN.ShowDialog(this);
        }

        private void buscarToolStripMenuItem1_Click(object sender, EventArgs e)
        {
            Venta_Mostrar vM = new Venta_Mostrar();
            this.Visible = false;
            vM.ShowDialog(this);
            this.Visible = true;
        }

       
    }
}
